package com.ljc.chatroom.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.xml.ws.Response;
import java.util.Map;
/**
 * @author: luojiacheng
 * @create: 2019/12/12 10:54
 * @description: Login Controller
 */

@Controller
public class LoginController {


    @GetMapping("/")
    public String index(){
        return "login";
    }

    /**
     * 登陆
     * @return 聊天室界面
     */
    @PostMapping("/login")
    public String login(@RequestParam(name = "username") String username, Map<String, Object> map){
        map.put("username",username);
        return "/chatroom";
    }

}
